//import Material 0.1
import QtQuick 2.4
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4

Rectangle {
    id: imageitem
    anchors.fill: parent

    border.color: "red"
       width: 150
       height:150
       // 定义信号
       signal testClicked(color colParam);	//该文件中发送带参信号

       Image {
           id:img
           anchors.fill: parent
           fillMode: Image.PreserveAspectFit
           source:"12345.jpg"
       }

       MouseArea {
           id: big_mouse
           anchors.fill: parent
           property point clickPos: "0,0"

           onPressed: {
               clickPos = Qt.point(mouse.x,mouse.y)
               console.log("onPressed:", mouse.x,mouse.y)

               emit: testClicked("#00a0ff");	//发送带参的信号

                imageitem.visible = false
                win.visible = true
           }
           onPositionChanged: {
               var deltdata = Qt.point(mouseX-clickPos.x, mouseY-clickPos.y);
               rect.x += deltdata.x
               rect.y += deltdata.y
           }
       }




}
